<template>
  <div>
    <ul>
      <li v-for="(item, index) in pageLists" :key="index">
        {{item.title}} {{item.content}}
      </li>
    </ul>
  </div>
</template>

<script>
import store from '@/store'
import axios from 'axios'

export default {
  name: 'List',
  store,
  data () {
    return {
      formData: {
        name: 'testVue',
        touch: '123455677',
        message: '123'
      }
    }
  },
  computed: {
    pageLists () {
      return store.state.lists
    }
  },
  created () {
    axios.post('http://localhost:8088/api/customer', this.formData, {
      headers: {
        'Content-Type': 'multipart/form-data',
        'data-type': 'application/json'
      }
    }).then((response) => {
        alert(response)
      }, (response) => {
        alert('error')
      })
  }
}
</script>
